package util.show;

import util.map.MarsMap;

public class View {

	private String viewstyle;

	public View() {
		viewstyle = "graphic";
	}

	public View(String viewstyle) {
		this.viewstyle = viewstyle;
	}

	public String getViewstyle() {
		return viewstyle;
	}

	public void setViewstyle(String viewstyle) {
		this.viewstyle = viewstyle;
	}

	public static void displayByDes(MarsMap marsmap) {
		System.out.println(marsmap.getDirDes());
	}

	public static void displayByGraphic(MarsMap marsmap) {
		int scope = marsmap.getScope();
		int capacity = scope * scope;

		int temp_x = marsmap.getX();
		int temp_y = marsmap.getY();
		char[][] charArr = new char[scope][scope];
		for (int i = 0; i < scope; ++i) {
			for (int j = 0; j < scope; ++j) {
				charArr[i][j] = '*';
			}
		}

		charArr[scope - temp_y][temp_x - 1] = 'A';
		for (int i = 0; i < scope; ++i) {
			for (int j = 0; j < scope; ++j) {
				System.out.print(charArr[i][j]);
			}
			System.out.println();
		}
		System.out.println();
		// List<String> list = new ArrayList(capacity+100);
		// for(int i = 0 ; i < scope ; ++i) {
		// for(int j = 0 ; j < scope ; ++j) {
		// list.add("*");
		// }
		// if(i != scope - 1) {
		// list.add("\n");
		// }
		// }
		// list.remove(pos);
		// list.add(pos,"A");

		// foreach(list);

	}

	// public static void foreach(Iterable itb) {
	// Iterator it = itb.iterator();
	// while (it.hasNext()) {
	// System.out.print(it.next());
	// }
	// }
}